#include <iostream>
using namespace std;

enum class Color1
{
    Red,
    Green,
    Blue
};

enum class Light : uint32_t
{
    Red,
    Yellow
};

enum class Color : uint8_t {
    Red,
    Green,
    Blue
};

 enum class Code {
        OK=200,
        NotFound=404,
        InternalServerError=500
    };
void setColor(Color c) {
    std::cout << "Setting color to: " << static_cast<int>(c) << std::endl;
} 
Color getFavoriteColor() {
    return Color::Blue;
}


int main()
{
    
//     Color c = Color::Red;
//     Light l = Light::Red;

//     if (c == Color::Red)
//     {
//         std::cout << "Color is Red\n";
//     }
// 

//std::cout << sizeof(Color) << std::endl;  // 输出：1


 

 Color c2 = static_cast<Color>(2);//不建议这样使用，如果整数不在枚举范围内，行为是未定义的。

 //setColor(Color::Blue); //做参数
 Color favorite = getFavoriteColor();  // 做返回值
 std::cout<<static_cast< int>(favorite)<<std::endl;



 
}